
		<div class="home_page thuvien">
			<div class="bg_thuvien">
				<div id="header">
					<div class="ribbon"><img src="<?php echo PATH_URL.'static/images/img_ribbon.png' ?>" alt="" /></div>
					<div class="menu">
        					<ul>
        						<li><a href="#" class="menu_trangchu"></a></li>
        						<li><a href="<?=PATH_URL.'tham-gia'?>"class="menu_thamgia"></a></li>
        						<li><a href="<?=PATH_URL.'thu-vien'?>"class="menu_thuvien"></a></li>
        						<li><a href="<?=PATH_URL.'the-le'?>" class="menu_thele"></a></li>
        						<li class="last"><a href="http://davitabone.vn/" class="menu_davita" target="_blank"></a></li>
        					</ul>
        				</div>
				</div>
				<div class="content_thuvien">
					<div class="content_main">
						<div class="title_select">
							<div><img src="<?php echo PATH_URL.'static/images/img_heart_1.png'?>" alt="" />Thư viện</div>
							<div class="border" style="width: 535px;"></div>
		                    <div class="back_page" style="position: absolute;width:50px;height:45px;right: 10px;top: -15px;"><a href="<?=PATH_URL.'thu-vien'?>"><img src="<?= PATH_URL.'static/images/popup_close_btn.png'?>" /></a></div> 
						</div>
						<div class="item_detail">
							
                            <?php if($contest->type == 1){ ?>
                                
                                        <div class="bg_video"></div>
                							<div class="img">
                                            <?php if($contest->link != ""){ ?>
                                                 <img src="<?php echo PATH_URL.'static/images/tim/timthumb.php?src='.PATH_URL.DIR_CONTEST_PHOTO.$contest->link.'&w=570&h=360&zc=1&q=100' ?>"  />
                                            <?php }else{ ?>
                                                <img  src="<?php echo PATH_URL.'static/images/tim/timthumb.php?src='.PATH_URL.'static/images/default.png'.'&w=570&h=360&zc=0&q=100' ?>" />
                                            <?php } ?>
                                            </div>
                                        
                                  
                               
                               
                            <?php }if($contest->type == 2){ ?>
                                <div class="bg_video"></div>
    							<div class="img">
                                <div class="player" id="player" ></div>
                                
                                <script type="text/javascript">
            
                                var flashvars = {link_media:'<?=PATH_URL.DIR_UPLOAD_CONTEST_VIDEO.$contest->link?>',link_image:'',type:'video',autoPlay:false,width:'570',height:'360'};
                                swfobject.embedSWF(root+'static/flash/MainPlayer.swf?v='+<?=rand(1,1000000)?>, 'player', '570', '360', '9.0.45', root+'/swfobject/expressinstall.swf', flashvars, {base:root + "static/flash/",bgcolor: '#CCCCCC', menu: 'false',allowFullScreen:'true',wmode:'transparent'});
                                           
                                </script>
                                </div>
                            <?php } if($contest->type == 3){ ?>
                                <div class="bg_video"></div>
    							<div class="img">
                                <div >
                                <div class="player" id="player"></div>
                                </div>
                                <script type="text/javascript">
            
                                var flashvars = {id:'<?=$contest->id?>',link_image:'',type:'video',autoPlay:false,width:'570',height:'360'};
                                swfobject.embedSWF(root+'static/flash/player_slide.swf?v='+<?=rand(1,1000000)?>, 'player', '570', '360', '9.0.45', root+'/swfobject/expressinstall.swf', flashvars, {base:root + "static/flash/",bgcolor: '#CCCCCC', menu: 'false',allowFullScreen:'true',wmode:'transparent'});
                                           
                                </script>
                                </div>
                            <?php }?>
                           
                            
                            <div class="text">Nội dung chia sẻ :  <?=$contest->content?> </div>
							<div class="text" style="margin-top: 15px;">
								<div class="left user">Đăng bởi <a href="JavaScript:void(0);"><?=$contest->fullname?></a></div>
								<div class="left like"><span class="total_like"><?=$contest->like?> </span><img src="<?php echo PATH_URL.'static/images/img_heart_2.png'?>" alt="" /> <a href="JavaScript:void(0);" onclick="return ajax_like_contest('<?=$contest->id?>');">Like</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="total_comment"><?=$contest->comment?> </span> <img src="<?php echo PATH_URL.'static/images/img_comment.png' ?>" alt="" />
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invite  <a href="JavaScript:void(0);" onclick="return invite2();"><img src="<?= PATH_URL.'static/images/invite.png'?>" /></a>
								</div>
								
                                <div class="right txt_r"><a href="JavaScript:void(0);" onclick="return share();"><img src="<?php echo PATH_URL.'static/images/img_chiase.png'?>" alt="" /></a></div>
								<div class="clear"></div>
							</div>
						</div>
						<div id="nice_scroll_comment">
							<div class="content_nice_scroll_comment">
								<?php
                            			if($comments){
                            				foreach($comments as $v){
                            				     
                                ?>
                               	<div class="item_comment">
									<div class="img left"><a href="JavaScript:void(0);"><img src="<?php echo PATH_URL.'static/images/img_avatar.png'?>" alt="" width="35" height="35"/></a></div>
									<div class="text mt10 left">
										<div><a href="JavaScript:void(0);"><?=$v->fullname?></a> : <?=$v->content?></div>
										<div class="likeuser"><?=getVNDateTime($v->created)?> </div>
									</div>
									<div class="clear"></div>
								</div>
                                <?php }}?>
							
								
							</div>
						</div>
						<div class="box_comment">
							<div class="jcarousel-avatar-wrapper">
								<div class="jcarousel-avatar">
									<ul>
										<li><img src="<?php echo PATH_URL.'static/images/img_avatar.png'?>" alt="Image 1"></li>
									   
									</ul>
								</div>
								<a href="#" class="jcarousel-control-prev"><img src="<?php echo PATH_URL.'static/images/btn_prev_1.png'?>" alt="" /></a>
								<a href="#" class="jcarousel-control-next"><img src="<?php echo PATH_URL.'static/images/btn_next_1.png'?>" alt="" /></a>
							</div>
							<div class="textarea"><textarea onclick="this.value=''" id="txtcomment">Viết bình luận của bạn...</textarea></div>
							<div class="text">Bình luận bởi <?=$user_data[0]->fullname?> </div>
					        <div class="erorr erorr1"></div>
                            <a href="JavaScript:void(0);" class="btn_submit" onclick="return ajax_comment_contest('<?=$contest->id?>');" ></a>
						</div>
						<div class="jcarousel-wrapper">
							<div class="jcarousel">
								<ul>
									<li><img src="<?php echo PATH_URL.'static/images/img_slide.png'?>" alt="Image 1"></li>
									<li><img src="<?php echo PATH_URL.'static/images//img_slide.png'?>" alt="Image 2"></li>
									<li><img src="<?php echo PATH_URL.'static/images/img_slide.png'?>" alt="Image 3"></li>
									<li><img src="<?php echo PATH_URL.'static/images/img_slide.png'?>" alt="Image 4"></li>
									<li><img src="<?php echo PATH_URL.'static/images/img_slide.png'?>" alt="Image 5"></li>
								</ul>
							</div>
							<a href="#" class="jcarousel-control-prev"><img src="<?php echo PATH_URL.'static/images/btn_prev.png'?>" alt="" /></a>
							<a href="#" class="jcarousel-control-next"><img src="<?php echo PATH_URL.'static/images/btn_next.png'?>" alt="" /></a>
						</div>
						
					</div>
				</div>
			</div>
		</div>
        <script>
        function share(){
            <?php 
             $thumb = "";
              if($contest->type == 1){
                $thumb = PATH_URL.DIR_CONTEST_PHOTO.$contest->link;
              }
              if($contest->type == 3){
                $thumb = PATH_URL.DIR_CONTEST_SLIDESHOW.$contest->link;
              }
              if($contest->type == 2){
                $thumb = PATH_URL.'static/images/default.png';
              }
            ?>
            var id ='<?=$contest->id?>';
            var title_new = '<?=SEO(CutText($contest->content,20))?>';
            var summary = '<?=SEO(CutText($contest->content,40))?>'
            var img = "<?=PATH_URL.'static/images/tim/timthumb.php?src='?>"+'<?=$thumb?>'+"<?='&w=200&h=200;zc=0&q=100'?>"; 
            var a= "<?=FB_REDIRECT_PAGE.'?app_data='?>";
            <?php 
            $a='{"id":"';
            $b='"}';
            $url_share_comment1 = rawurlencode($a);
            $url_share_comment2 = rawurlencode($b);
            ?>
            
            var var1 =  "<?=$url_share_comment1?>";
            var var2 =  "<?=$url_share_comment2?>";
            var url = a+var1+id+var2;
            
            link_share = 'https://www.facebook.com/sharer/sharer.php?s=100&p%5bmedium%5d=106&p%5btitle%5d='+encodeURIComponent(title_new)+'&p%5bsummary%5d='+encodeURIComponent(summary)+'&p%5burl%5d='+encodeURIComponent(url)+'&p%5bimages%5d%5b0%5d='+encodeURIComponent(img);
            window.open(link_share+"&display=popup",'_blank','width=650,height=450,status=no,toolbar=no,menubar=no,location=no');    
            
        
        }
        function invite2()
        {
            link = '<?=$this->session->userdata('FB_REDIRECT_PAGE')?>';
            img ='<?= PATH_URL.'static/images/logo.png'?>';
            title = 'Vì người phụ nữ  thân yêu.';
            var title_invite_contest=title;
            var des_invite=title;
            FB.ui({
                method: 'apprequests',
                message: title_invite_contest
            }, function (response) {
                if (response && response.to) {
                    var id=String(response.to);
                    //var _link = root+_link1;
                    
                    $.each(id.split(','), function(key, value) { 
                        FB.api('/'+value+'/feed', 'post', {
                            //message: link,
                            picture: img,
                            caption: decodeURIComponent(title),
                            name: decodeURIComponent(title),
                            link:link,
                            description:des_invite
                        }, function(response) {
                            if (!response || response.error) {
                                console.log('Error occured');
                            } else {
                                console.log('Post ID: ' + response.id);
                            }
                        }); 
                    });
                }
            });
            return false;     
        }

</script>
	<div id="footer"><a href="http://davitabone.vn/" target="_blank" class="logo"><img src="<?php echo PATH_URL.'static/images/img_footer.jpg'?>" alt="" /></a></div>